<?php
/**
 * @ClassName: OrderType
 * @Description: 订单类型枚举
 * @author: wyaohu
 * @Date: 2024/9/8 20:21
 * @Version: V1.0.0
 */

namespace app\common\enum;

class OrderType
{
    const shop = 1;
    const hotel = 2;
    const water = 3;
    const points = 4;
    const equipment = 5;
    const monthly_settle = 6;
    const spa = 7;
    const gift_pack = 8;
    const water_rack = 9;
    const bucket = 10;

    const water_ticket = 'water_ticket';
    const door_ticket = 'door_ticket';
    const water_shelf = 'water_shelf';
    const disposable_bucket = 'disposable_bucket';
    const circular_bucket = 'circular_bucket';

    /**
     * 订单类型，1联盟订单，2酒店订单，3订水订单，4积分订单，5设备订单，6月结订单，7SPA订单，8礼包订单，9水架订单，10水桶订单
     * @param $level
     * @return string|string[]
     */
    public static function typeText($level)
    {
        $desc = [
            OrderType::shop => '联盟',
            OrderType::hotel => '酒店',
            OrderType::water => '订水',
            OrderType::points => '积分',
            OrderType::equipment => '设备',
            OrderType::monthly_settle => '月结',
            OrderType::spa => 'SPA',
            OrderType::gift_pack => '礼包',
            OrderType::water_rack => '水架',
            OrderType::bucket => '水桶',
        ];
        if ($level === true) {
            return $desc;
        }
        return $desc[$level] ?? $level;
    }

    /**
     * 订单标识
     * @param $level
     * @return string|string[]
     */
    public static function tagsText($level)
    {
        $desc = [
            OrderType::water_ticket => '水票',
            OrderType::door_ticket => '门票',
            OrderType::water_shelf => '水架',
            OrderType::disposable_bucket => '一次性桶',
            OrderType::circular_bucket => '循环桶',
        ];
        if ($level === true) {
            return $desc;
        }
        return $desc[$level] ?? $level;
    }

}